<%-- 
    Document   : store_refill
    Created on : Jun 7, 2012, 9:28:38 PM
    Author     : praneeth
--%>

<%@page import="java.sql.*" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Store_refill JSP Page</title>
    </head>
    <body>    <h4>Refill Success</h4>
         
           <%
        
        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
           String rid1=request.getParameter("rid");
           String cname1=request.getParameter("cname");
           String c_id=request.getParameter("cid");
           String d_id=request.getParameter("did");
           //String chek=request.getParameter("yes");
           String d=request.getParameter("day");
           String m=request.getParameter("month");
           String y=request.getParameter("year");
           
           String date=(m+"/"+d+"/"+y);
           
           String q1="insert into Refill values('"+rid1+"','"+cname1+"','"+c_id+"','"+d_id+"','"+date+"')";
                    
           System.out.println(q1);

                   Connection connection=DriverManager.getConnection("jdbc:odbc:egasdsn");
                     Statement stmt =connection.createStatement();
                       int rs=stmt.executeUpdate(q1);
                          // out.println(q1+"  "+rs);
                             if(rs==1)
                                 out.println("Thankyou.... ");                                            
        %>
    </body>
</html>
